﻿@model ORM.ViewModels.Guides.GuideBookmarkListViewModel
<div id="guideBookmarkList" class="roundedField" style="background-color: antiquewhite; padding-top: 10px; padding-left: 10px">
    <div align="center" style="font-weight: bold">Các Hướng Dẫn Đã Lưu</div><br/>
    <div style="height: 300px">
    <div style="height: 90%">
        @foreach (var item in Model.Guides)
    {
        <a class="titleLink" href="/Guide/Details/@item.Id">@item.Title</a><br/>
    }
    </div> 
    
    <table width="100%">
        <tr>
            <td style="text-align: left; width: 15%">
                @if (Model.PageNo != 1)
                {
                    var targetDiv = "guideBookmarkList";
                    var previousPage = @Model.PageNo - 1;
                    <input type="image" src="/Content/Images/hide-left.ico" id="btnGoFirst" onclick="GoToGuideBookMarksPage(1, '@targetDiv')" style="width: 20px; height: 20px;" title = "Xem Trang Đầu Tiên" />
                    <input type="image" src="/Content/Images/navigate-left.ico" id="btnGoPrevious" onclick="GoToGuideBookMarksPage('@previousPage', '@targetDiv')" style="width: 20px; height: 20px;" title = "Xem Trang Trước" />
                }
            </td>
            <td style="text-align: center; width: 75%">
                @if (Model.TotalPage == 0)
                {
                    <span>Bạn chưa lưu hướng dẫn nào vào sổ tay</span>
                }
                else
                {
                    <span>Trang @Model.PageNo Trên Tổng Số @Model.TotalPage Trang</span>
                }
                
            </td>
            <td style="text-align: right; width: 15%">
                @if (Model.PageNo != Model.TotalPage && Model.TotalPage != 0)
                {
                    var targetDiv = "guideBookmarkList";
                    var nextPage = @Model.PageNo + 1;
                    <input type="image" src="/Content/Images/navigate-right.ico" id="btnGoNext" onclick="GoToGuideBookMarksPage('@nextPage', '@targetDiv')" style="width: 20px; height: 20px" title="Xem Trang Sau" />
                    <input type="image" src="/Content/Images/hide-right.ico" id="btnGoNext" onclick="GoToGuideBookMarksPage('@Model.TotalPage', '@targetDiv')" style="width: 20px; height: 20px" title = "Xem Trang Cuối"/>
                }
            </td>
        </tr>
    </table>
</div>
</div>
